<template>
  <div>
    <h1>第一题</h1>
    <h1>{{ name }}</h1>
    <button @click="fn">随机</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      name: "",
      arr: ["小花", "小明", "小可爱", "小王"],
    };
  },
  methods: {
    fn() {
      this.name = this.arr[Math.floor(Math.random() * this.arr.length)];
    },
  },
};
</script>

<style>
</style>
